#include "hilo_CONTEXT.h"

#ifndef _HILO_CONTEXT_C_
#define _HILO_CONTEXT_C_

//
// Macro used to make defining members easier within the Python object.
//

#define CONTEXT_REG(reg, type) {#reg, type, offsetof(hilo_CONTEXT,cContext.##reg), 0, "Access to " #reg}

PyMemberDef hilo_CINT::members[] = {
    CONTEXT_REG(Eax,T_UINT),
	CONTEXT_REG(Ebx,T_UINT),
	CONTEXT_REG(Ecx,T_UINT),
	CONTEXT_REG(Edx,T_UINT),
	CONTEXT_REG(Esi,T_UINT),
	CONTEXT_REG(Edi,T_UINT),
	CONTEXT_REG(Esp,T_UINT),
	CONTEXT_REG(Ebp,T_UINT),
	CONTEXT_REG(Eip,T_UINT),
    {NULL}
};

#undef CONTEXT_REG

PyMethodDef hilo_CINT::methods[] = {
	{NULL} 
};

PyTypeObject hilo_CINT::type = {
    PyObject_HEAD_INIT(NULL)
    0,                         /*ob_size*/
    "hilo.CONTEXT",            /*tp_name*/
    sizeof(hilo_CONTEXT),      /*tp_basicsize*/
    0,                         /*tp_itemsize*/
    0,						   /*tp_dealloc*/
    0,                         /*tp_print*/
    0,                         /*tp_getattr*/
    0,                         /*tp_setattr*/
    0,                         /*tp_compare*/
    0,                         /*tp_repr*/
    0,                         /*tp_as_number*/
    0,                         /*tp_as_sequence*/
    0,                         /*tp_as_mapping*/
    0,                         /*tp_hash */
    0,                         /*tp_call*/
    0,                         /*tp_str*/
    0,                         /*tp_getattro*/
    0,                         /*tp_setattro*/
    0,                         /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT,		   /*tp_flags*/
    "Stores the state of a thread's registers", /* tp_doc */
    0,		               /* tp_traverse */
    0,		               /* tp_clear */
    0,		               /* tp_richcompare */
    0,		               /* tp_weaklistoffset */
    0,		               /* tp_iter */
    0,		               /* tp_iternext */
	hilo_CINT::methods,       /* tp_methods */
    hilo_CINT::members,       /* tp_members */
};

#endif